import { Module } from '@nestjs/common'
import { MongooseModule } from '@nestjs/mongoose'
import { Merchant, MerchantSchema } from './merchant.schema'
import { MerchantController } from './merchant.controller'
import { MerchantService } from './merchant.service'
import {BrandController} from "./brand/brand.controller"
import {BrandService} from "./brand/brand.service"
import { Brand, BrandSchema } from './brand/brandschema'
import {Shop,ShopSchema} from "./shop/shop.shcema"
import {ShopController} from "./shop/shop.controller"
import { ShopService } from './shop/shop.service'
import {AreaService} from "./area/area.service"
import {Area,AreaSchema} from "./area/area.schema"
import {AreaController} from "./area/area.controller"
import {BindController} from "./bind/bind.controller"
import {BindService} from "./bind/bind.service"
import {Bind, BindSchema} from "./bind/bind.schema"
import {Printer, PrinterSchema} from "./printer/printer.schema"
import {PrinterController} from "./printer/printer.controller"
import {PrinterService} from "./printer/printer.service"
@Module({
    imports: [
        // 导入
        MongooseModule.forFeature([
            {
                name: Merchant.name, // 模型名
                schema: MerchantSchema, // 模型对应的Schema
                collection: 'merchant', // 集合名
            },
            {
                name:Brand.name,
                schema:BrandSchema,
                collection:'brand'
            },
            {
                name:Shop.name,
                schema:ShopSchema,
                collection:'shop'
            },
            {
                name:Area.name,
                schema:AreaSchema,
                collection:'area'
            },
            {
                name:Bind.name,
                schema:BindSchema,
                collection:'bind'
            },
            {
                name:Printer.name,
                schema:PrinterSchema,
                collection:'printer'
            }
            
        ]), 
    ],
    controllers: [MerchantController, BrandController, ShopController, AreaController, BindController, PrinterController], // 控制器
    providers: [MerchantService, BrandService,ShopService,AreaService, BindService,PrinterService], // 服务
})
export class MerchantModule {
}